package com.example.seakdreamandroid.cardQuest;

import androidx.annotation.InspectableProperty;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.example.seakdreamandroid.R;

public class AssessResultActivity extends AppCompatActivity {
    TextView amount;
    TextView advicea;
    Button back;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_assess_result);
        initview();
        Intent intent = getIntent();
        String point = intent.getStringExtra("count");
        String advice = intent.getStringExtra("advice");
        advicea.setText(advice);
        amount.setText(point+"分");
        CircleProgressView progressView = findViewById(R.id.point);
        //起始角度
        progressView.setStartAngle(90);
        //进度条颜色
        progressView.setProgressColor(Color.parseColor("#d81b60"));
        //背景圆颜色
        progressView.setBackgroundCircleColor(Color.parseColor("#f1f1f1"));
        //进度条宽度
        progressView.setProgressWidth(CommonUtil.dp2px(this, 16));
        //动画持续时间
        progressView.setDuration(1000);
        //切割圆的终止角度
        progressView.setEndAngle(300);
        //CircleProgressView.TYPE_CLIP 切割圆
        //CircleProgressView.TYPE_CIRCLE 整圆
        progressView.setProgressType(CircleProgressView.TYPE_CIRCLE);
        //设置进度条起始、终止形状   Paint.Cap.ROUND：圆形   Paint.Cap.BUTT：普通平面
        progressView.setCap(Paint.Cap.ROUND );
        //设置当前进度，开启动画
        progressView.setProgress(Integer.parseInt(point), true);


        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });



    }

    private void initview() {
        amount = findViewById(R.id.fenshu);
        advicea = findViewById(R.id.advice);
        back = findViewById(R.id.blackMain);
    }
}